Skip to content

refactor: collapse run_smoke.py onto the PyAutoHands runner (198 → 77 lines) - #16

Merged
Jammy2211 merged 1 commit into
mainfrom
claude/smoke-copy-drift-ci-docs-ozntvv
Aug 24, 2026
Merged

refactor: collapse run_smoke.py onto the PyAutoHands runner (198 → 77 lines)#16
Jammy2211 merged 1 commit into
mainfrom
claude/smoke-copy-drift-ci-docs-ozntvv

Conversation

@Jammy2211

Copy link
Copy Markdown
Collaborator

Summary

Phase 1 of PyAutoHands#260. .github/scripts/run_smoke.py was one of ten
vendored copies of the same machinery across the workspace repos. It becomes a
thin delegator over autohands/run_python.py — the shape the HowTo repos have
used all along.

The copies were not merely duplicated, they were expensive. Each of the last
three fixes had to be swept across every copy by hand: the env-resolver fork
(PyAutoHands#185), the per-script timeout and process-group kill (#226/#227),
and the jupyter guard. The HowTo tier needed none of those sweeps, precisely
because it holds no logic.

The blocker was never behaviour, it was discovery model — the shared runner
was opt-out (no_run.yaml) while this gate is opt-in (smoke_tests.txt).
PyAutoHands#261 closed that with --list.

This repo needed a second PyAutoHands fix

autocti_workspace_test is the only workspace with no
config/build/no_run.yaml, and the autohands-level fallback path does not exist
either. Both shared runners opened that file unconditionally, so the delegator
would have crashed with FileNotFoundError before running a single script —
once at module load and again in parse_no_run_reasons under --report-dir.

PyAutoHands#262 makes a missing no_run.yaml non-fatal under --list (with
an allowlist there is nothing for it to filter), while discovery still requires
it, since a run with no exclusion policy is not a safe default. Verified against
exactly this repo's shape before this PR was written.

Behaviour preserved — verified, not assumed

  • Env resolution is identical. The old runner passed a relative script
    path to build_env_for_script; the shared runner passes an absolute one.
    All 3 listed scripts were resolved both ways and diffed: 0 differences.
  • Timeout and kill are the same code this file already imported from
    build_util (timeout_for, kill_group).
  • No profile args, so the shared runner's extra-args support changes nothing.
  • Every entry in smoke_tests.txt resolves to a file that exists (3/3).

--report-dir is load-bearing: run_python.py only propagates failure when a
report was built, so without it the gate would be vacuously green.

Test Plan

  • The no-no_run.yaml shape run end-to-end: completes, writes its report,
    exits 0 all-green and 1 on a failure
  • PyAutoHands suite green (389 passed) on the runner this delegates to
  • This repo's own smoke gate on this PR — the real verification

Requires PyAutoHands#261 and #262, both merged.

Generated by the PyAutoLabs agent workflow.


Generated by Claude Code

…7 lines)

Phase 1 of PyAutoHands#260. This file was one of ten vendored copies of the
same machinery across the workspace repos; it becomes a thin delegator over
`autohands/run_python.py`, the shape the HowTo repos have used all along.

The copies were not merely duplicated, they were EXPENSIVE. Each of the last
three fixes had to be swept across every copy by hand: the env-resolver fork
(PyAutoHands#185), the per-script timeout and process-group kill (#226/#227),
and the jupyter guard. The HowTo tier needed none of those sweeps, precisely
because it holds no logic. The blocker to collapsing was never behaviour but
discovery model — the shared runner was opt-out (no_run.yaml) while this gate
is opt-in (smoke_tests.txt) — and PyAutoHands#261 closed that with `--list`.

Behaviour is preserved, verified rather than assumed:

- Env resolution is IDENTICAL. The old runner passed a relative script path to
  build_env_for_script; the shared runner passes an absolute one. Every listed
  script was resolved both ways and diffed: 0 differences across all four
  repos (and 0 across the three user workspaces). Pattern matching is
  substring/stem based, so the path form does not matter, and no profile
  pattern can collide with the absolute prefix.
- The per-script BUILD_SCRIPT_TIMEOUT cap and the process-group kill are the
  same implementation this file already imported from build_util.
- No profile in this repo sets per-script `args`, so the shared runner's
  extra-args support changes nothing here.
- Every entry in smoke_tests.txt resolves to a file that exists.

`config/build/no_run.yaml` is deliberately NOT applied to the allowlist. It is
policy for the release mega-run and notebook generation; smoke_tests.txt is
policy for this gate, and a script legitimately appears in both. Honouring
no_run here would have silently dropped 13 scripts across four repos from smoke
coverage — measured, and fixed in PyAutoHands#262 before this landed.

`--report-dir` is load-bearing: run_python.py only propagates failure when a
report was built, so without it the gate would be vacuously green.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01UpSFum81Jeq9KZ9wdKtaeZ
@Jammy2211
Jammy2211 merged commit 08aa4b6 into main Aug 24, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants